from django.db import models


# Create your models here.
class Menu(models.Model):
    name=models.CharField('菜单名',max_length=30,unique=True)
    parent = models.ForeignKey("self", null=True, blank=True, on_delete=models.SET_NULL, verbose_name="父菜单")
    icon = models.CharField(max_length=50, null=True, blank=True, verbose_name="图标")
    code = models.CharField(max_length=50, null=True, blank=True, verbose_name="编码")
    url = models.CharField(max_length=128, null=True, blank=True)
    number = models.FloatField(null=True, blank=True, verbose_name="编号")

class Role(models.Model):
    name = models.CharField(max_length=32, unique=True, verbose_name="角色")
    permissions = models.ManyToManyField(Menu,blank=True, verbose_name="URL授权")
    desc = models.CharField(max_length=50, blank=True, null=True, verbose_name="描述")
